package com.example.demo07cache.dao;

import com.example.demo07cache.entity.Employee;
import org.springframework.stereotype.Repository;

import java.util.concurrent.ConcurrentHashMap;

/**
 * @author tpln
 */
@Repository
public class JetCacheDao {

    private static final ConcurrentHashMap<Integer, Employee> employees = new ConcurrentHashMap<>();

    static {
        employees.put(1 , new Employee(1, "角落处的一抹微光", "184131523@qq.com"));
        employees.put(2 , new Employee(2, "无敌", "wudi@qq.com"));
        employees.put(3 , new Employee(3, "无趣", "wuqu@qq.com"));
    }

    public Employee getEmployeeById(Integer id) {
        return employees.get(id);
    }
}
